Change project templates to have separate "http" and "https" launch profiles #42027
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In support of [EPIC] Revisiting HTTPS defaults in ASP.NET Core
Update project templates so that (assuming the
--no-httpsoption is false) two launch profiles are configured in the project'slaunchSettings.jsonfile:ApplicationUrlsproperty set to just a non-https addressApplicationUrlsproperty set to the usual two addresses, the first being https, the second being http:Selecting an auth option of anything other than None or Indvidual in relevant templates will still force https like today & only create a single launch profile due to issues with these auth schemes use of cookies and SameSite.
The Angular & SPA templates that utilize the
SpaProxyare currently authored in such a way that only https works (irrespective of the auth option) so they're not changed.When launching this project at the command line using
dotnet runordotnet watch, the default profile selected will be the first profile, which is not configured to use https, and as such the application will start without attempting to bind to https and thus not attempt to load the dev cert (which causes UX friction issues esp. on non-Windows systems). The https profile can be selected at launch time by passing--launch-profile <launch-profile>todotnet run, e.g.:The project will continue to have the https-aware code present so the project is ready for use with https.